home *** CD-ROM | disk | FTP | other *** search
INI File | 1996-07-31 | 38.4 KB | 1,226 lines |
- ;-------------------------------------------------------------------
- ;
- ; MODULE NAME: OEMSETUP.INF
- ;
- ; DESCRIPTION: Installation parameter script for busmaster
- ; network adapter drivers running under
- ; Microsoft Windows NT.
- ;
- ; This script is interpreted by SETUP.EXE
- ; during driver installation. It consists
- ; of the following four required sections
- ; and other supporting sections:
- ;
- ; 1. Identify
- ; 2. ReturnOptions
- ; 3. InstallOption
- ; 4. Source Media Descriptions
- ;-------------------------------------------------------------------
-
- ;-------------------------------------------------------------------
- ; SECTION NAME: Identify
- ;
- ; DESCRIPTION: This required section verifies that this
- ; script supports the option currently selected.
- ;
- ; INPUT: None.
- ;
- ; OUTPUT: $($R0) Status
- ; $($R1) Option Type
- ; $($R2) Diskette Description
- ;-------------------------------------------------------------------
-
- [Identify]
-
- set Status = STATUS_SUCCESSFUL
- set OptionType = NetAdapter
- set Media = #("Source Media Descriptions", 1, 1)
- return $(Status) $(OptionType) $(Media)
-
- [Source Media Descriptions]
-
- 1 = "IBM Streamer Installation Disk"
- ; 2 = "Windows NT Setup CD-ROM Disk"
-
- [Signature]
- FileType = MICROSOFT_DRVLIB_FILE
- [GetSignature]
- read-syms Signature
- return $(FileType)
-
- ;-------------------------------------------------------------------
- ; SECTION NAME: ReturnOptions
- ;
- ; DESCRIPTION: This required section returns the list of
- ; options supported by this script and the
- ; text list representing the options.
- ;
- ;
- ; INPUT: $($0) Language code
- ;
- ; OUTPUT: $($R0) Status
- ; $($R1) Option List
- ; $($R2) Option Text List
- ;-------------------------------------------------------------------
-
- [ReturnOptions]
-
- set Status = STATUS_FAILED
- set OptionList = {}
- set OptionTextList = {}
- set LanguageList = ^(LanguagesSupported, 1)
-
- ifcontains(i) $($0) not-in $(LanguageList)
- set Status = STATUS_NOLANGUAGE
- goto End_ReturnOptions
- endif
-
- ifstr(i) $($1) == ""
- goto OK_ReturnOptions
- endif
-
- set PlatformList = ^(PlatformsSupported, 1)
- Ifcontains(i) $($1) in $(PlatformList)
- goto OK_ReturnOptions
- else
- set Status = STATUS_NOTSUPPORTED
- goto End_ReturnOptions
- endif
-
- OK_ReturnOptions = +
- set OptionList = ^(Options, 1)
- set OptionTextList = ^(OptionsText$($0), 1)
- set Status = STATUS_SUCCESSFUL
-
- End_ReturnOptions = +
- Return $(Status) $(OptionList) $(OptionTextList)
-
- [LanguagesSupported]
-
- ENG
-
- [PlatformsSupported]
-
- MCA
- ISA
- EISA
- PCI
- [Options]
-
- STREAMER
-
- [OptionsTextENG]
-
- STREAMER = "IBM Streamer Family Adapters"
-
-
- ;-------------------------------------------------------------------
- ;
- ; SECTION NAME: InstallOption
- ;
- ; DESCRIPTION: This required section is shelled to by main
- ; installation processing or by NCPASHEL.INF
- ; during reconfiguration, removal, update,
- ; etc. It performs three main functions:
- ;
- ; 1. Copies files representing options
- ; 2. Configures the installed option
- ; 3. Updates the registry for the installed
- ; option.
- ;
- ; INPUT: $($0) Language to use
- ; $($1) OptionID to install
- ; $($2) SourceDirectory
- ; $($3) AddCopy (YES | NO)
- ; $($4) DoCopy (YES | NO)
- ; $($5) DoConfig (YES | NO)
- ;
- ; OUTPUT: $($R0) Status
- ;
- ;------------------------------------------------------------------------
-
- [InstallOption]
-
- StartWait
-
- set Status = STATUS_FAILED
-
- set Option = $($1)
- set SrcDir = $($2)
- set AddCopy = $($3)
- set DoCopy = $($4)
- set DoConfig = $($5)
-
- set LanguageList = ^(LanguagesSupported, 1)
- Ifcontains(i) $($0) NOT-IN $(LanguageList)
- Return STATUS_NOLANGUAGE
- endif
-
- read-syms GeneralConstants
- read-syms FileConstants
- read-syms FileConstants$(!STF_LANGUAGE)
-
- detect date
-
- set-title $(FunctionTitle)
-
- set to = Begin
- set from = Begin
-
- set CommonStatus = STATUS_SUCCESSFUL
-
- EndWait
-
- Begin = +
-
- ifstr(i) $(!NTN_InstallMode) == DeInstall
- set from = fatal
- set to = fatal
- goto RemoveAdapter
- endif
-
- ifstr(i) $(!NTN_InstallMode) == Update
- set from = fatal
- set to = fatal
- goto UpgradeSoftware
- endif
-
- ifstr(i) $(!NTN_InstallMode) == Bind
- set from = fatal
- set to = fatal
- goto BindingAdapter
- endif
-
- ifstr(i) $(!NTN_InstallMode) == Configure
- set CommonStatus = STATUS_REBOOT
- ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
- Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
- ifint $($ShellCode) != $(!SHELL_CODE_OK)
- goto ShellCodeError
- endif
- set Error = $($R0)
- set from = end
- set to = end
- goto NonFatalInfo
- endif
- set from = fatal
- set to = fatal
- goto ConfigureAdapter
- endif
-
- set OEM_ABANDON_OPTIONS = {}
- set OEM_ABANDON_SOFTWARE = FALSE
- set OEM_ABANDON_ON = TRUE
- set from = fatal
- set to = fatal
- goto InstallAdapter
-
- InstallAdapter = +
-
- OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
-
- Ifstr $(KeyProduct) == $(KeyNull)
- set OldVersionExisted = $(FALSE)
- goto LoadDLL
- endif
-
- OldInstall = +
-
- CloseRegKey $(KeyProduct)
-
- ifstr(i) $(!NTN_RegBase) == $(ProductKeyName)
-
- Shell $(UtilityInf), VerExistedDlg, $(ProductSoftwareTitle),+
- $(ProductVersion)
-
- ifint $($ShellCode) != $(!SHELL_CODE_OK)
- goto ShellCodeError
- endif
-
- goto end
-
- endif
-
- Shell $(UtilityInf), CardExistedDlg
-
- ifint $($ShellCode) != $(!SHELL_CODE_OK)
- goto ShellCodeError
- endif
-
- ifstr(i) $($R1) != "OK"
- Set CommonStatus = STATUS_USERCANCEL
- goto end
- endif
-
- set OldVersionExisted = $(TRUE)
-
- LoadDLL = +
-
- set OldSource = $(!STF_SRCDIR)
-
- Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(!STF_SRCDIR)
-
- Ifint $($ShellCode) != $(!SHELL_CODE_OK)
- goto fatal
- endif
- Ifstr(i) $($R0) == STATUS_FAILED
- goto fatal
- endif
- Ifstr(i) $($R0) == STATUS_USERCANCEL
- goto end
- endif
-
- set !STF_SRCDIR = $($R1)
-
- install "Install-Dll"
-
- set !STF_SRCDIR = $(OldSource)
-
- StartWait
-
- ;
- ; PH 03/14/95 - Added 170 and 171 for dual adapters
- ;
- Set STREAMER_2BYTE = 143
- Set STREAMER_1BYTE_LIST = {160, 162, 164, 168, 170, 171}
- Set AdapterList = {}
-
- ForListDo $(STREAMER_1BYTE_LIST)
-
- Set STREAMER_1BYTE = $($)
-
- set-mul mcaid = $(STREAMER_2BYTE), 256
- set-add mcaid = $(mcaid), $(STREAMER_1BYTE)
- set-dectohex mcaid_hex = $(mcaid)
-
- Shell $(UtilityInf), MCAFindBus, $(STREAMER_1BYTE), $(STREAMER_2BYTE)
-
- ifint $($ShellCode) != $(!SHELL_CODE_OK)
- goto ShellCodeError
- endif
-
- ifstr $($R0) != "NO_ERROR"
- set Error = $($R0)
- goto fatal
- endif
-
- ifstr(i) $($R1) != {}
-
- set MCA_List = $($R1)
-
- ForListDo $(MCA_List)
-
- Set BusSlotMca = $($)
-
- Set BusNum = *($(BusSlotMca),1)
- Set SlotNum = *($(BusSlotMca),2)
- Set NetcardId = *($(BusSlotMca),3)
- Set DualPort = "0"
- Set BusSlotMca = {$(BusNum),$(SlotNum),$(NetcardId),+
- $(DualPort)}
- Set AdapterList = >($(AdapterList),$(BusSlotMca))
- ;
- ; If this is a dual adapter, make a second
- ; list entry for the "B" side
- ;
- ifint $(STREAMER_1BYTE) == 170
- Set DualPort = "1"
- Set BusSlotMca = {$(BusNum),$(SlotNum),$(NetcardId),+
- $(DualPort)}
- Set AdapterList = >($(AdapterList),$(BusSlotMca))
- endif
- ifint $(STREAMER_1BYTE) == 171
- Set DualPort = "1"
- Set BusSlotMca = {$(BusNum),$(SlotNum),$(NetcardId),+
- $(DualPort)}
- Set AdapterList = >($(AdapterList),$(BusSlotMca))
- endif
- ;
- EndForListDo
-
- endif
-
- EndForListDo
-
- ; ------------------------------------------------------------
- ; Prompt for PCI card installation
- ; ------------------------------------------------------------
-
- Set PromptForPci = "NO"
- ifstr(i) $(!STF_BUSTYPE) == "PCI"
- Set PromptForPci = "YES"
- else
- ForListDo $(!STF_BUSTYPELIST)
- ifstr(i) $($) == "PCI"
- Set PromptForPci = "YES"
- endif
- EndForListDo
- endif
-
- set Vendor_ID = 4116
- set Device_ID = $(PCI_ADAPTER_ID)
-
- Shell "", GetPCIInformation, $(Vendor_ID), $(Device_ID)
-
- ifint $($ShellCode) != $(!SHELL_CODE_OK)
- goto ShellCodeError
- endif
-
- ifstr(i) $($R0) != {}
-
- set PCI_List = $($R0)
-
- ForListDo $(PCI_List)
-
- Set BusSlotPCI = $($)
-
- Set BusNum = *($(BusSlotPCI),1)
- Set SlotNum = *($(BusSlotPCI),2)
- Set NetcardId = $(PCI_ADAPTER_ID)
- Set DualPort = "0"
- Set BusSlotPCI = {$(BusNum),$(SlotNum),$(NetcardId),+
- $(DualPort)}
- Set AdapterList = >($(AdapterList),$(BusSlotPCI))
- EndForListDo ; End of PCI_List
-
- endif
- ; ------------------------------------------------------------
- ; End of PCI logic
- ; ------------------------------------------------------------
-
- ifstr(i) $(AdapterList) == {}
- set Error = $(CANNOT_FIND_ANY_CARD)
- set CommonStatus = STATUS_USERCANCEL
- set from = "end"
- goto nonfatal
- endif
-
- ifint $(OldVersionExisted) == $(FALSE)
- goto NewDriverInstall
- else
- goto AfterNewDriverInstall
- endif
-
- NewDriverInstall = +
-
- Ifstr(i) $(DoCopy) == "YES"
- Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
- Ifint $($ShellCode) != $(!SHELL_CODE_OK)
- Goto ShellCodeError
- Else-Ifstr(i) $($R0) == STATUS_FAILED
- Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
- ifint $($ShellCode) != $(!SHELL_CODE_OK)
- goto ShellCodeError
- endif
- set Error = $($R0)
- Goto fatal
- Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
- Goto successful
- Endif
- Set SrcDir = $($R1)
- Endif
-
- install "Install-Option"
-
- ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
- Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
- ifint $($ShellCode) != $(!SHELL_CODE_OK)
- goto ShellCodeError
- endif
- set Error = $($R0)
- goto fatal
- endif
-
- Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
- $(ProductSoftwareName), +
- $(ProductSoftwareName), +
- $(ProductSoftwareTitle), $(STF_CONTEXTINFNAME), +
- $(ProductSoftwareImagePath), "kernel", "NDIS", {}, "",+
- $(NetEventDLL)
-
- Set OEM_ABANDON_SOFTWARE = TRUE
-
- ifint $($ShellCode) != $(!SHELL_CODE_OK)
- goto ShellCodeError
- endif
-
- set RegistryErrorIndex = $($R0)
- Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
- EndWait
- CloseRegKey $($R1)
- CloseRegKey $($R2)
- CloseRegKey $($R3)
- CloseRegKey $($R4)
- CloseRegKey $($R5)
- goto FatalRegistry
- endif
-
- Set SoftProductKey = $($R1)
- Set SoftNetRuleKey = $($R2)
- Set SoftServiceKey = $($R3)
- Set SoftParameterKey = $($R4)
- Set SoftLinkageKey = $($R5)
-
- set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
- {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
- {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
- {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)},+
- {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)},+
- {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareName)},+
- {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
-
- Shell $(UtilityInf), AddValueList, $(SoftProductKey), $(NewValueList)
-
- ifint $($ShellCode) != $(!SHELL_CODE_OK)
- goto ShellCodeError
- endif
-
- set RegistryErrorIndex = $($R0)
- Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
- EndWait
- CloseRegKey $(SoftProductKey)
- CloseRegKey $(SoftNetRuleKey)
- CloseRegKey $(SoftServiceKey)
- CloseRegKey $(SoftParameterKey)
- CloseRegKey $(SoftLinkageKey)
- goto FatalRegistry
- endif
-
- set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareType)},+
- {use,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareUse)}, +
- {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareBindForm)}, +
- {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareClass)}, +
- {bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareBindable)}, +
- {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
-
- Shell $(UtilityInf), AddValueList, $(SoftNetRuleKey), $(NewValueList)
-
- ifint $($ShellCode) != $(!SHELL_CODE_OK)
- goto ShellCodeError
- endif
-
- set RegistryErrorIndex = $($R0)
- CloseRegKey $(SoftProductKey)
- CloseRegKey $(SoftNetRuleKey)
- CloseRegKey $(SoftServiceKey)
- CloseRegKey $(SoftParameterKey)
- CloseRegKey $(SoftLinkageKey)
- Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
- EndWait
- goto FatalRegistry
- endif
-
- AfterNewDriverInstall = +
-
- ForListDo $(AdapterList)
-
-
-
- Set BusSlotMca = $($)
-
- Set BusNum = *($(BusSlotMca),1)
- Set SlotNum = *($(BusSlotMca),2)
- Set NETCARD_ID = *($(BusSlotMca),3)
- Set DualPort = *($(BusSlotMca),4)
- ; -------------------------------------------------
- ; If netcard is already installed, skip this entry
- ; -------------------------------------------------
-
- Set AlreadyInstalled = "NO"
-
- ; Make a list of all the installed netcards
-
- OpenRegKey +
- $(!REG_H_LOCAL),+
- "",+
- $(NetworkCardKeyName),+
- $(MAXIMUM_ALLOWED),+
- IE_KeyNetcards
- Ifstr $(IE_KeyNetcards) == $(KeyNull)
- set RegistryErrorIndex = UNABLE_OPEN_NETWORKCARD_SECTION
- goto FatalRegistry
- endif
- EnumRegKey $(IE_KeyNetcards) IE_KeyNameList
-
- ; Compare all the NetworkCards entries to see whether
- ; they match the current bus number, slot number, title,
- ; and product name.
-
- ForListDo $(IE_KeyNameList)
- set IE_KeyName = *($($),1)
- OpenRegKey +
- $(IE_KeyNetcards),+
- "",+
- $(IE_KeyName),+
- $(MAXIMUM_ALLOWED),+
- IE_Card
- Ifstr $(IE_Card) == $(KeyNull)
- set RegistryErrorIndex = UNABLE_OPEN_NETWORKCARD_SECTION
- goto FatalRegistry
- endif
-
- GetRegValue $(IE_Card),"Description", DescriptionInfo
- GetRegValue $(IE_Card),"ProductName", ProductNameInfo
- set CardDescription = *($(DescriptionInfo), 4)
- set CardProductName = *($(ProductNameInfo), 4)
-
- ifstr(i) $(CardDescription) == $(ProductHardwareDescription)
- ifstr(i) $(CardProductName) == $(ProductHardwareName)
-
- ; The product type matches. Now check for a
- ; match on bus number, slot number, and dual
- ; port.
-
- GetRegValue $(IE_Card), "ServiceName", ServiceNameInfo
- Set ServiceName = *($(ServiceNameInfo), 4)
-
- OpenRegKey +
- $(!REG_H_LOCAL),+
- "",+
- "SYSTEM\CurrentControlSet\Services\"$(ServiceName)"\Parameters",+
- $(MAXIMUM_ALLOWED),+
- IE_KeyService
-
- Ifstr $(IE_KeyService) == $(KeyNull)
- set RegistryErrorIndex = UNABLE_OPEN_NETWORKCARD_SECTION
- goto FatalRegistry
- endif
-
- ; We are now in the parameters key for the adapter
- ; to which we are comparing the current adapter
-
- GetRegValue $(IE_KeyService), "BusNumber", BusInfo
- set CardBusNum = *($(BusInfo), 4)
-
- GetRegValue $(IE_KeyService), "SlotNumber", SlotInfo
- set CardSlotNum = *($(SlotInfo), 4)
-
- GetRegValue $(IE_KeyService), "DualPort", DualInfo
- Ifint $(RegLastError) == 0
- set CardDualPort = *($(DualInfo), 4)
- else
- set CardDualPort = "0"
- endif
-
- ifint $(CardBusNum) == $(BusNum)
- ifint $(CardSlotNum) == $(SlotNum)
- ifint $(CardDualPort) == $(DualPort)
- Set AlreadyInstalled = "YES"
- endif
- endif
- endif
- endif
- endif
- EndForListDo
-
- ifstr $(AlreadyInstalled) == "YES"
- goto NextAdapter
- endif
-
- ; -------------------------------------------------
- ; The netcard has not yet been installed. Add
- ; it now.
- ; -------------------------------------------------
-
- Shell $(UtilityInf), AddHardwareComponent, +
- $(ProductHardwareName),+
- $(STF_CONTEXTINFNAME),+
- $(ProductKeyName)
-
- ifint $($R4) != -1
- Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$($R4))
- endif
-
- ifint $($ShellCode) != $(!SHELL_CODE_OK)
- goto ShellCodeError
- endif
- set RegistryErrorIndex = $($R0)
- Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
- EndWait
- CloseRegKey $($R1)
- CloseRegKey $($R2)
- CloseRegKey $($R3)
- goto FatalRegistry
- endif
-
- Set HardNetCardKey = $($R1)
- Set HardNetRuleKey = $($R2)
- Set HardParameterKey = $($R3)
- Set AdapterNumber = $($R4)
-
- ifint $(NETCARD_ID) == 36768
- set MyTitle = "Slot "$(SlotNum)": IBM LANStreamer MC 32 Adapter"
- else-ifint $(NETCARD_ID) == 36770
- set MyTitle = "Slot "$(SlotNum)": IBM Auto LANStreamer MC 32 Adapter"
- else-ifint $(NETCARD_ID) == 36772
- set MyTitle = "Slot "$(SlotNum)": IBM LANStreamer MC 16 Adapter"
- else-ifint $(NETCARD_ID) == 36776
- set MyTitle = "Slot "$(SlotNum)": IBM EtherStreamer MC 32 Adapter"
- else-ifint $(NETCARD_ID) == 36778
- ifint $(DualPort) == 0
- Set MyTitle = "Slot "$(SlotNum)A": IBM Dual AutoLANStreamer MC 32 Adapter"
- else
- Set MyTitle = "Slot "$(SlotNum)B": IBM Dual AutoLANStreamer MC 32 Adapter"
- endif
- else-ifint $(NETCARD_ID) == 36779
- ifint $(DualPort) == 0
- Set MyTitle = "Slot "$(SlotNum)A": IBM Dual EtherStreamer MC 32 Adapter"
- else
- Set MyTitle = "Slot "$(SlotNum)B": IBM Dual EtherStreamer MC 32 Adapter"
- endif
- else-ifint $(NETCARD_ID) == $(PCI_ADAPTER_ID)
- set MyTitle = "["$(SlotNum)"] IBM LANStreamer PCI Adapter"
- else
- set MyTitle = "["$($R4)"] "$(ProductHardwareTitle)
- endif
-
- Set MyService = "Streamer"$(AdapterNumber)
-
- Set NewValueList = {{Manufacturer,$(NoTitle),$(!REG_VT_SZ),$(Manufacturer)},+
- {Title,$(NoTitle),$(!REG_VT_SZ),$(MyTitle)},+
- {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareDescription)},+
- {ProductName,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareName)},+
- {ServiceName,$(NoTitle),$(!REG_VT_SZ),$($R5)},+
- {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
-
- Shell $(UtilityInf), AddValueList, $(HardNetCardKey), $(NewValueList)
-
- ifint $($ShellCode) != $(!SHELL_CODE_OK)
- goto ShellCodeError
- endif
-
- CloseRegKey $(HardParameterKey)
-
- RunProgram ExitCode "" "" $(!STF_WINDOWSSYSPATH)"\stsetup.exe" +
- $(MyService) $(SlotNum) $(NETCARD_ID) $(DualPort) $(BusNum)
-
- set CFG_ReturnCode = $(DLG_PB_CANCEL)
- ifint $(ExitCode) == 0
- set CFG_ReturnCode = $(DLG_PB_OK)
- endif
-
- ifint $(CFG_ReturnCode) != $(DLG_PB_OK)
- set CommonStatus = STATUS_USERCANCEL
- goto abandon
- endif
-
- set TempProdName = """"$(ProductHardwareName)$(AdapterNumber)""""
- set TempBindForm = $(TempProdName)$(NetRuleHardwareBindForm)
- set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleHardwareType)},+
- {bindform,$(NoTitle),$(!REG_VT_SZ),$(TempBindForm)}, +
- {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleHardwareClass)}, +
- {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
-
- Shell $(UtilityInf), AddValueList, $(HardNetRuleKey), $(NewValueList)
-
- CloseRegKey $(HardNetCardKey)
- CloseRegKey $(HardNetRuleKey)
- CloseRegKey $(HardParameterKey)
-
- ifint $($ShellCode) != $(!SHELL_CODE_OK)
- goto ShellCodeError
- endif
-
- NextAdapter = +
-
- EndForListDo ; End of AdapterList
-
- LastAdapter = +
-
- EndWait
-
- goto successful
-
- ConfigureAdapter = +
-
- OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(MAXIMUM_ALLOWED) NetCardKey
- ifstr(i) $(NetCardKey) == ""
- set CommonStatus = STATUS_USERCANCEL
- goto successful
- endif
- GetRegValue $(NetCardKey) "ServiceName" ServiceInfo
- set ServiceName = *($(ServiceInfo),4)
- CloseRegKey $(NetCardKey)
-
- OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\"$(ServiceName)"\Parameters" $(MAXIMUM_ALLOWED) ParamKey
- ifstr(i) $(ParamKey) == ""
- goto successful
- endif
-
- set NETCARD_ID = "?"
- GetRegValue $(ParamKey),"McaPosId", RegList
- ifstr *($(RegList), 4) != ""
- set NETCARD_ID = *($(RegList), 4)
- endif
-
- set SlotNum = "?"
- GetRegValue $(ParamKey),"SlotNumber", RegList
- ifstr *($(RegList), 4) != ""
- set SlotNum = *($(RegList), 4)
- endif
-
- set SlotPort = "0"
- GetRegValue $(ParamKey),"DualPort", RegList
- ifstr *($(RegList), 4) != ""
- set DualPort = *($(RegList), 4)
- endif
-
- set BusNum = "?"
- GetRegValue $(ParamKey),"BusNumber", RegList
- ifstr *($(RegList), 4) != ""
- set BusNum = *($(RegList), 4)
- endif
- CloseRegKey $(ParamKey)
-
- RunProgram ExitCode "" "" $(!STF_WINDOWSSYSPATH)"\stsetup.exe" +
- $(ServiceName) $(SlotNum) $(NETCARD_ID) $(DualPort) $(BusNum)
-
- set CFG_ReturnCode = $(DLG_PB_CANCEL)
- ifint $(ExitCode) == 0
- set CFG_ReturnCode = $(DLG_PB_OK)
- endif
-
- ifint $(CFG_ReturnCode) != $(DLG_PB_OK)
- set CommonStatus = STATUS_USERCANCEL
- goto end
- endif
-
- goto successful
-
- BindingAdapter =+
-
- set Error = "Binding: Sorry, not yet implemented."
- goto fatal
-
- RemoveAdapter = +
-
- Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
-
- Shell $(UtilityInf), RemoveSoftwareComponent, +
- $(Manufacturer), +
- $(ProductSoftwareName)
-
- ifint $($ShellCode) != $(!SHELL_CODE_OK)
- goto ShellCodeError
- endif
-
- set RegistryErrorIndex = $($R0)
-
- Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
- goto FatalRegistry
- endif
-
- else
-
- Shell $(UtilityInf), RemoveHardwareComponent, +
- $(Manufacturer), +
- $(ProductSoftwareName), +
- $(!NTN_RegBase)
-
- ifint $($ShellCode) != $(!SHELL_CODE_OK)
- goto ShellCodeError
- endif
-
- set RegistryErrorIndex = $($R0)
-
- Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
- goto FatalRegistry
- endif
-
- endif
-
- goto end
-
- UpgradeSoftware = +
-
- ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
-
- OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
-
- Ifstr $(KeyProduct) != $(KeyNull)
-
- GetRegValue $(KeyProduct),"MajorVersion", VersionInfo
- set Version = *($(VersionInfo), 4)
-
- Shell $(UtilityInf), GetInfFileNameFromRegistry, $(KeyProduct)
-
- ifint $($ShellCode) != $(!SHELL_CODE_OK)
- goto ShellCodeError
- endif
-
- set !UG_Filename = $($R0)
-
- ifstr(i) $(!UG_Filename) != ""
- install "Install-Update"
- ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
- goto fatal
- endif
- endif
-
- SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
- SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
-
- ifint $(Version) != $(ProductVersion)
- endif
-
- CloseRegKey $(KeyProduct)
-
- else
-
- goto FatalRegistry
-
- endif
-
- else
-
- OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) +
- $(MAXIMUM_ALLOWED) NetworkCardKey
-
- Ifstr(i) $(NetworkCardKey) != $(KeyNull)
- GetRegValue $(NetworkCardKey),"ServiceName", ServiceNameInfo
- set ServiceName = *($(ServiceNameInfo), 4)
- OpenRegKey $(NetworkCardKey) "" "NetRules" +
- $(MAXIMUM_ALLOWED) NetRuleKey
-
- Ifstr(i) $(NetRuleKey) != $(KeyNull)
- else
- goto FatalRegistry
- endif
-
- CloseRegKey $(NetRules)
- CloseRegKey $(NetworkCardKey)
- else
- goto FatalRegistry
- endif
-
- OpenRegKey $(!REG_H_LOCAL) "" +
- $(!NTN_ServiceBase)"\"$(ServiceName) +
- $(MAXIMUM_ALLOWED) ServiceKey
-
- Ifstr(i) $(ServiceKey) != $(KeyNull)
- CloseRegKey $(ServiceKey)
- else
- goto FatalRegistry
- endif
- endif
-
- goto end
-
- successful = +
- goto end
-
- abandon = +
- ForListDo $(OEM_ABANDON_OPTIONS)
- Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
- $(ProductSoftwareName), $($)
- ifint $($ShellCode) != $(!SHELL_CODE_OK)
- goto ShellCodeError
- endif
- set RegistryErrorIndex = $($R0)
- Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
- goto FatalRegistry
- endif
- EndForListDo
-
- Ifstr(i) $(OEM_ABANDON_SOFTWARE) == TRUE
- Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
- $(ProductSoftwareName), FALSE
- ifint $($ShellCode) != $(!SHELL_CODE_OK)
- goto ShellCodeError
- endif
- set RegistryErrorIndex = $($R0)
- Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
- goto FatalRegistry
- endif
- endif
- goto end
-
- warning = +
- Shell $(SubroutineInf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
- ifint $($ShellCode) != $(!SHELL_CODE_OK)
- goto ShellCodeError
- endif
- ifstr(i) $($R1) == "OK"
- goto $(to)
- else-ifstr(i) $($R1) == "CANCEL"
- goto $(from)
- else
- goto "end"
- endif
-
- NonFatalInfo = +
- Set CommonStatus = STATUS_USERCANCEL
- Set Severity = STATUS
- goto NonFatalMsg
-
- nonfatal = +
- Set Severity = NONFATAL
- goto NonFatalMsg
-
- NonFatalMsg = +
- ifstr(i) $(Error) == ""
- Set Severity = NONFATAL
- Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
- ifint $($ShellCode) != $(!SHELL_CODE_OK)
- goto ShellCodeError
- endif
- set Error = $($R0)
- endif
- Shell $(SubroutineInf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
- ifint $($ShellCode) != $(!SHELL_CODE_OK)
- goto ShellCodeError
- endif
- ifstr(i) $($R1) == "OK"
- goto $(from)
- else
- goto "end"
- endif
-
- FatalRegistry = +
- Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
- ifint $($ShellCode) != $(!SHELL_CODE_OK)
- goto ShellCodeError
- endif
- set Error = $($R0)
- goto fatal
-
- fatal = +
- ifstr(i) $(Error) == ""
- Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
- ifint $($ShellCode) != $(!SHELL_CODE_OK)
- goto ShellCodeError
- endif
- set Error = $($R0)
- endif
- Shell $(SubroutineInf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
- ifint $($ShellCode) != $(!SHELL_CODE_OK)
- goto ShellCodeError
- endif
- goto setfailed
-
- ShellCodeError = +
- set DlgType = "MessageBox"
- set STF_MB_TITLE = $(ShellCodeErrorTitle)
- set STF_MB_TEXT = $(ShellCodeErrorText)
- set STF_MB_TYPE = 1
- set STF_MB_ICON = 3
- set STF_MB_DEF = 1
- ui start "Error Message"
- goto setfailed
-
- setfailed = +
- set CommonStatus = STATUS_FAILED
- ifstr(i) $(OEM_ABANDON_ON) == TRUE
- set OEM_ABANDON_ON = FALSE
- goto abandon
- endif
- goto end
-
- end = +
- goto term
-
- term = +
-
- Return $(CommonStatus)
-
- [GeneralConstants]
-
- from = ""
- to = ""
- KeyNull = ""
- MAXIMUM_ALLOWED = 33554432
- RegistryErrorIndex = NO_ERROR
- KeyProduct = ""
- TRUE = 1
- FALSE = 0
- NoTitle = 0
- OldVersionExisted = $(FALSE)
-
-
- [FileConstants]
-
- UtilityInf = "UTILITY.INF"
- SubroutineInf = "SUBROUTN.INF"
- SoftwareType = "driver"
- StreamerDLL = "callcfg.dll"
- NetEventDLL = "%SystemRoot%\System32\netevent.dll"
- DLG_PB_OK = 1281 ; User pressed "OK" pushbutton
- DLG_PB_CANCEL = 1282 ; User pressed "CANCEL" pushbutton
- PCI_ADAPTER_ID = 24 ; 0x0018 in decimal
- Manufacturer = "Microsoft"
- ProductMajorVersion = "3"
- ProductMinorVersion = "1"
- ProductVersion = $(ProductMajorVersion)"."$(ProductMinorVersion)
- ProductSoftwareName = "Streamer"
- ProductSoftwareImagePath = "%SystemRoot%\system32\drivers\streamer.sys"
- NetRuleSoftwareType = "StreamerSys ndisDriver StreamerDriver"
- NetRuleSoftwareUse = $(SoftwareType)
- NetRuleSoftwareBindForm = """StreamerSys"" yes no container"
- NetRuleSoftwareClass = {"streamer basic"}
- NetRuleSoftwareBindable = {"streamerDriver streamerAdapter non exclusive 100"}
- ProductHardwareName = "Streamer"
- NetRuleHardwareType = "Streamer streamerAdapter"
- NetRuleHardwareBindForm = " yes yes container"
- NetRuleHardwareClass = {"streamerAdapter basic"}
- ProductKeyName = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"
- ParamKeyName = $(!NTN_ServiceBase)"\"$(ProductHardwareName)"\Parameters"
- NetworkCardKeyName = $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards"
-
- [FileConstantsENG]
-
- FunctionTitle = "IBM Streamer Family Adapter Card Setup"
- ProductSoftwareDescription = "IBM Streamer Family Adapter Driver"
- ProductHardwareDescription = "IBM Streamer Family Adapter "
- CANNOT_FIND_ANY_CARD = "Network card is not present in the system"
- ProductSoftwareTitle = "IBM Streamer Family Adapter Driver"
- ProductHardwareTitle = "IBM Streamer Family Adapter "
- ShellCodeErrorTitle = "Error: "$(FunctionTitle)
- ShellCodeErrorText = "OEMSETUP.INF Shell Code Error."
-
- [date]
- Now = {} ? $(!LIBHANDLE) GetSystemDate
-
- [Files-Dll]
- 1, stsetup.exe, SIZE=29696
- 1, callcfg.dll, SIZE=24576
- 1, cfgedit.exe, SIZE=68608
-
- [Files-Inf]
- 1, oemsetup.inf, SIZE=40600, RENAME=$(!UG_Filename)
-
- [Files-STREAMER]
-
- 1, STREAMER.SYS, SIZE=112192
-
- [Install-Option]
-
- set STF_VITAL = ""
-
- ifstr(i) $(AddCopy) == "YES"
-
- AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
-
- endif
-
- ifstr(i) $(DoCopy) == "YES"
-
- set !STF_NCPA_FLUSH_COPYLIST = TRUE
- CopyFilesInCopyList
-
- endif
-
- Exit
-
- [Install-Update]
- set STF_VITAL = ""
- set STF_OVERWRITE = "VERIFYSOURCEOLDER"
-
- AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
- AddSectionFilesToCopyList Files-Inf $(SrcDir) $(!STF_WINDOWSSYSPATH)
-
- set !STF_NCPA_FLUSH_COPYLIST = TRUE
- CopyFilesInCopyList
- exit
-
- [Install-Dll]
- set STF_VITAL = ""
- AddSectionFilesToCopyList Files-Dll $(!STF_SRCDIR) $(!STF_WINDOWSSYSPATH)
- CopyFilesInCopyList
- exit
-
- ;*************************************************************************
- ;
- ; SECTION: GetPCIInformation
- ;
- ; PURPOSE: Get PCI vendor and device information
- ;
- ; ARGUMENTS: $0 Vendor ID
- ; $1 Device ID
- ;
- ;
- ; RETURNS: $R0 List of bus and slot information
- ; {{bus0,slot0},{bus1,slot1},{bus2,slot2}...{busk,slotk}}
- ;
- ; REFERENCES: Nothing
- ;
- ; MODIFIES: Nothing
- ;
- ;*************************************************************************
-
- [GetPCIInformation]
- read-syms InitBaseVars
- set VendorID = $($0)
- set DeviceID = $($1)
- set MultiAdapter = "HARDWARE\Description\System\MultifunctionAdapter"
- set InfoList = {}
-
- OpenRegKey $(!REG_H_LOCAL) "" $(MultiAdapter) $(MAXIMUM_ALLOWED) KeyMultiAdapter
-
- Ifstr $(KeyMultiAdapter) == $(KeyNull)
- goto GetPCIInformation_return
- endif
-
- EnumRegKey $(KeyMultiAdapter) BusList
-
- Debug-Output "Buslist"
- Debug-Output $(BusList)
-
- ForListDo $(BusList)
- set BusNum = *($($),1)
- OpenRegKey $(!REG_H_LOCAL) "" $(MultiAdapter)"\"$(BusNum) $(MAXIMUM_ALLOWED) KeyMultiAdapterBus
- GetRegValue $(KeyMultiAdapterBus) "Identifier" IdentifierInfo
- ifstr(i) *($(IdentifierInfo),4) == "PCI"
- ;
- ; Only check for PCI bus
- ;
- set device = 0
- next_device = +
- ifint $(device) < 32
- set function = 0
- next_function = +
- ifint $(function) < 8
- LibraryProcedure Result, $(!LIBHANDLE), GetPciInformation, $(BusNum), $(device), $(function)
- debug-output $(BusNum)".."$(device)".."$(function)".."$(Result)
- ifint *($(Result),1) == 65535
- Set-add device = $(device),1
- goto next_device
- endif
- ifint *($(Result),1) == $(VendorID)
- ifint *($(Result),2) == $(DeviceID)
- set InfoList = >($(InfoList),{$(BusNum),$(device),$(function)})
- endif
- endif
- set-add function = $(function), 1
- goto next_function
- endif
- Set-add device = $(device),1
- goto next_device
- endif
- finish_bus = +
- endif
- EndForListDo
-
- CloseRegKey $(KeyMultiAdapter)
-
- GetPCIInformation_return = +
- return $(InfoList)
-
-
- ;
- ; Initialize general constants
- ;
- [InitBaseVars]
-
- KeyNull = ""
- MAXIMUM_ALLOWED = 33554432
- KeyInfo = {}
- RegistryErrorIndex = NO_ERROR
- NoTitle = 0
-
- CurrentControlSet = "SYSTEM\CurrentControlSet"
- ServicesBaseName = $(CurrentControlSet)"\Services"
- NetworkCardKeyName = $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards"
-
- !RegLastError = NO_ERROR
-
-